/**
 * 项目名：phms3
 * 日期：    2019-12-01 17:02:29
 * Copyright (c) 2015- HTSC-版权所有
 */

package com.joysuch.wwyt.bp.entity;

import static java.lang.Enum.valueOf;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_store_house")
@SQLDelete(sql = "update wwyt_bp_store_house set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_store_house set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpStoreHouse implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 租户
    //上级库房id
    private Long parentId;
    private Long tenentId;
    // 组织机构代码
    private String orgCode;
    // 装置编号
    private String code;
    //子库房下一个编号
    private Integer childNo;
    // 装置名称
    private String name;
    //    // 库区名称
//    private String storeAreaName;
//    // 库区编号
//    private String storeAreaCode;0

    // 装置位置
    private String location;
    // 库房面积
    private Double storeHouseSize;
    // 有无防火墙
    private String fireWallFlag;
    // 库房形式
    private String storeHouseForm;
    // 设计储量
    private Double designStock;
    // 投产日期
    // private java.time.LocalDate startUseTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startUseTime;
    // 是否设置自动喷淋
    private String autoSprayFlag;
    // 是否危化品仓库
    private String hazardChemStoreFlag;
    // 是否剧毒化学品仓库
    private String hypertoxicHazardChemStoreFlag;
    // 是否低温储存仓库
    private String lowTemperatureStoreFlag;
    // 火灾危险性分类
    private String fireDangerType;
    // 是否重点监管的危险化学品
    private String majorMonitoringChemFlag;
    // 所属重大危险源单元
    private Long majorHazardId;
    // 所属重大危险源单元编号
    private String majorHazardUnitCode;
    //0物资仓库,1危化品仓库
    private Integer typeFlag;
    // 创建时间
    private java.time.LocalDateTime createTime;
    // 创建人
    private Long createBy;
    // 更新人
    private Long updateBy;
    // 更新时间
    private java.time.LocalDateTime updateTime;
    // 删除标记
    private String deleteFlag;
    // columns END

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "CODE", length = 30)
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }

    @Column(name = "child_no")
    public Integer getChildNo() {
        return this.childNo;
    }

    public void setChildNo(Integer value) {
        this.childNo = value;
    }

    @Column(name = "NAME", length = 30, nullable = false)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "parent_id")
    public Long getParentId() {
        return this.parentId;
    }

    public void setParentId(Long value) {
        this.parentId = value;
    }


//    @Column(name = "STORE_AREA_NAME", length = 30)
//    public String getStoreAreaName() {
//        return this.storeAreaName;
//    }
//
//    public void setStoreAreaName(String value) {
//        this.storeAreaName = value;
//    }
//
//    @Column(name = "STORE_AREA_CODE", length = 30)
//    public String getStoreAreaCode() {
//        return this.storeAreaCode;
//    }
//
//    public void setStoreAreaCode(String value) {
//        this.storeAreaCode = value;
//    }

    @Column(name = "LOCATION", length = 128)
    public String getLocation() {
        return this.location;
    }

    public void setLocation(String value) {
        this.location = value;
    }

    @Column(name = "STORE_HOUSE_SIZE")
    public Double getStoreHouseSize() {
        return this.storeHouseSize;
    }

    public void setStoreHouseSize(Double value) {
        this.storeHouseSize = value;
    }

    @Column(name = "FIRE_WALL_FLAG", length = 2)
    public String getFireWallFlag() {
        return this.fireWallFlag;
    }

    public void setFireWallFlag(String value) {
        this.fireWallFlag = value;
    }

    @Column(name = "STORE_HOUSE_FORM", length = 32)
    public String getStoreHouseForm() {
        return this.storeHouseForm;
    }

    public void setStoreHouseForm(String value) {
        this.storeHouseForm = value;
    }

    @Column(name = "DESIGN_STOCK")
    public Double getDesignStock() {
        return this.designStock;
    }

    public void setDesignStock(Double value) {
        this.designStock = value;
    }

//    @Column(name = "START_USE_TIME")
//    public java.time.LocalDate getStartUseTime() {
//        return this.startUseTime;
//    }
//
//    public void setStartUseTime(java.time.LocalDate value) {
//        this.startUseTime = value;
//    }

    @Column(name = "START_USE_TIME")
    public Date getStartUseTime() {
        return this.startUseTime;
    }

    public void setStartUseTime(Date value) {
        this.startUseTime = value;
    }

    @Column(name = "AUTO_SPRAY_FLAG", length = 2)
    public String getAutoSprayFlag() {
        return this.autoSprayFlag;
    }

    public void setAutoSprayFlag(String value) {
        this.autoSprayFlag = value;
    }

    @Column(name = "HAZARD_CHEM_STORE_FLAG", length = 2)
    public String getHazardChemStoreFlag() {
        return this.hazardChemStoreFlag;
    }

    public void setHazardChemStoreFlag(String value) {
        this.hazardChemStoreFlag = value;
    }

    @Column(name = "HYPERTOXIC_HAZARD_CHEM_STORE_FLAG", length = 2)
    public String getHypertoxicHazardChemStoreFlag() {
        return this.hypertoxicHazardChemStoreFlag;
    }

    public void setHypertoxicHazardChemStoreFlag(String value) {
        this.hypertoxicHazardChemStoreFlag = value;
    }

    @Column(name = "LOW_TEMPERATURE_STORE_FLAG", length = 2)
    public String getLowTemperatureStoreFlag() {
        return this.lowTemperatureStoreFlag;
    }

    public void setLowTemperatureStoreFlag(String value) {
        this.lowTemperatureStoreFlag = value;
    }

    @Column(name = "FIRE_DANGER_TYPE", length = 32)
    public String getFireDangerType() {
        return this.fireDangerType;
    }

    public void setFireDangerType(String value) {
        this.fireDangerType = value;
    }

    @Column(name = "MAJOR_MONITORING_CHEM_FLAG", length = 2)
    public String getMajorMonitoringChemFlag() {
        return this.majorMonitoringChemFlag;
    }

    public void setMajorMonitoringChemFlag(String value) {
        this.majorMonitoringChemFlag = value;
    }

    @Column(name = "MAJOR_HAZARD_ID")
    public Long getMajorHazardId() {
        return majorHazardId;
    }

    public void setMajorHazardId(Long majorHazardId) {
        this.majorHazardId = majorHazardId;
    }

    @Column(name = "MAJOR_HAZARD_UNIT_CODE", length = 20)
    public String getMajorHazardUnitCode() {
        return this.majorHazardUnitCode;
    }

    public void setMajorHazardUnitCode(String value) {
        this.majorHazardUnitCode = value;
    }

    @Column(name = "type_flag")
    public Integer getTypeFlag() {
        return typeFlag;
    }

    public void setTypeFlag(Integer typeFlag) {
        this.typeFlag = typeFlag;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.time.LocalDateTime getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.time.LocalDateTime value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.time.LocalDateTime getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.time.LocalDateTime value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("tenentId", getTenentId()).append("orgCode", getOrgCode()).append("code", getCode())
                .append("parentId", getParentId()).append("")
//                .append("name", getName()).append("storeAreaName", getStoreAreaName())
//                .append("storeAreaCode", getStoreAreaCode()).append("houseNo", getHouseNo())
                .append("location", getLocation()).append("storeHouseSize", getStoreHouseSize())
                .append("fireWallFlag", getFireWallFlag()).append("storeHouseForm", getStoreHouseForm())
                .append("designStock", getDesignStock()).append("startUseTime", getStartUseTime())
                .append("autoSprayFlag", getAutoSprayFlag()).append("hazardChemStoreFlag", getHazardChemStoreFlag())
                .append("hypertoxicHazardChemStoreFlag", getHypertoxicHazardChemStoreFlag())
                .append("lowTemperatureStoreFlag", getLowTemperatureStoreFlag())
                .append("fireDangerType", getFireDangerType())
                .append("majorMonitoringChemFlag", getMajorMonitoringChemFlag())
                .append("majorHazardUnitCode", getMajorHazardUnitCode()).append("typeFlag", getTypeFlag()).append("createTime", getCreateTime())
                .append("createBy", getCreateBy()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpStoreHouse == false)
            return false;
        if (this == obj)
            return true;
        BpStoreHouse other = (BpStoreHouse) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
